streamlit-nightly 1.43.3.dev20250317__py3-none-any.whl → 1.43.3.dev20250318__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. streamlit/config.py +134 -35
  2. streamlit/config_option.py +4 -1
  3. streamlit/config_util.py +1 -1
  4. streamlit/material_icon_names.py +1 -1
  5. streamlit/proto/NewSession_pb2.py +16 -16
  6. streamlit/proto/NewSession_pb2.pyi +8 -2
  7. streamlit/runtime/app_session.py +9 -6
  8. streamlit/runtime/scriptrunner/script_runner.py +1 -1
  9. streamlit/static/index.html +2 -2
  10. streamlit/static/static/css/{index.DQZt7VFg.css → index.BOl9eq08.css} +1 -1
  11. streamlit/static/static/js/{FileDownload.esm.DPWNg8L0.js → FileDownload.esm.qg6FU0gn.js} +1 -1
  12. streamlit/static/static/js/{FileHelper.Be9l1B23.js → FileHelper.BjsqRSXf.js} +1 -1
  13. streamlit/static/static/js/{FormClearHelper.Ck_v4Tgg.js → FormClearHelper.lrCbq3h9.js} +1 -1
  14. streamlit/static/static/js/{Hooks.B0Mdn8OE.js → Hooks.DLM8-GOj.js} +1 -1
  15. streamlit/static/static/js/{InputInstructions.DEfhAJgc.js → InputInstructions.C6xqeBjt.js} +1 -1
  16. streamlit/static/static/js/{ProgressBar.D34ZfmP5.js → ProgressBar.CwnbGH4T.js} +1 -1
  17. streamlit/static/static/js/{RenderInPortalIfExists.D7rG7dkm.js → RenderInPortalIfExists.DBosjlw4.js} +1 -1
  18. streamlit/static/static/js/{Toolbar.BKx7cxA3.js → Toolbar.DPjbmT0r.js} +1 -1
  19. streamlit/static/static/js/{base-input.D400PpZv.js → base-input.DYN8lKyb.js} +1 -1
  20. streamlit/static/static/js/{checkbox.T2_9UyBa.js → checkbox.DHvRlo93.js} +1 -1
  21. streamlit/static/static/js/{createSuper.B6r1ToQR.js → createSuper.ClJZbMNR.js} +1 -1
  22. streamlit/static/static/js/{data-grid-overlay-editor.CGbd5q6g.js → data-grid-overlay-editor.CBlXaHUd.js} +1 -1
  23. streamlit/static/static/js/{downloader.CfgCJjqI.js → downloader.D-SIwsMu.js} +1 -1
  24. streamlit/static/static/js/{es6.BIR4_s9Q.js → es6.RZQgn996.js} +2 -2
  25. streamlit/static/static/js/{iframeResizer.contentWindow.BvHB3v_q.js → iframeResizer.contentWindow.CXViiYfd.js} +1 -1
  26. streamlit/static/static/js/{index.P1KdGEyu.js → index.9SqbTcLN.js} +1 -1
  27. streamlit/static/static/js/{index.C5wG0y4e.js → index.9un9ip3K.js} +1 -1
  28. streamlit/static/static/js/{index.Dl7G-PpD.js → index.B683Y0MV.js} +1 -1
  29. streamlit/static/static/js/{index.D7KT3HOJ.js → index.BLNPtZ0I.js} +1 -1
  30. streamlit/static/static/js/{index.CWQVC9i9.js → index.BOAw4pUA.js} +1 -1
  31. streamlit/static/static/js/{index.B1y58sqw.js → index.BYzci3kh.js} +1 -1
  32. streamlit/static/static/js/{index.DgjRgqmt.js → index.BjS7LGRO.js} +1 -1
  33. streamlit/static/static/js/{index.4XxlReRC.js → index.BnRmaj0q.js} +1 -1
  34. streamlit/static/static/js/index.BrmZ2YXw.js +2 -0
  35. streamlit/static/static/js/{index.B6BwNYBs.js → index.Bz8bUQom.js} +1 -1
  36. streamlit/static/static/js/{index.D3XyyrNG.js → index.C-HVVl5G.js} +1 -1
  37. streamlit/static/static/js/{index.B5Gc6Qwv.js → index.CI-nHxA-.js} +1 -1
  38. streamlit/static/static/js/{index.wuPpurow.js → index.CJNnM66H.js} +1 -1
  39. streamlit/static/static/js/{index.Bw2C-uyr.js → index.COChIdSa.js} +1 -1
  40. streamlit/static/static/js/{index.DdaG6BEp.js → index.CVwvNsMT.js} +1 -1
  41. streamlit/static/static/js/{index.BD1Jat0A.js → index.CaO-RWxy.js} +1 -1
  42. streamlit/static/static/js/{index.ChU_mie6.js → index.ChEumMTh.js} +1 -1
  43. streamlit/static/static/js/{index.BebPGQSk.js → index.Cjhlljyd.js} +1 -1
  44. streamlit/static/static/js/{index.CY8FtTk0.js → index.Clo5LWpc.js} +1 -1
  45. streamlit/static/static/js/{index.YQ7W-YC2.js → index.CqnxBfXn.js} +1 -1
  46. streamlit/static/static/js/{index.M8jMYQHQ.js → index.CqzRlT_N.js} +1 -1
  47. streamlit/static/static/js/{index.1Y_wlVII.js → index.Cvp6swyX.js} +1 -1
  48. streamlit/static/static/js/{index.BlTWh14x.js → index.DC-G9iGy.js} +5 -5
  49. streamlit/static/static/js/{index.-19Q4tZa.js → index.DJnKVyky.js} +1 -1
  50. streamlit/static/static/js/{index.BZJaY1ZU.js → index.DPBPYkVj.js} +1 -1
  51. streamlit/static/static/js/{index.2z1MQMgc.js → index.DXtp2vWQ.js} +1 -1
  52. streamlit/static/static/js/{index.CPHXX3ut.js → index.Df97B7YB.js} +1 -1
  53. streamlit/static/static/js/{index.CW3wpu7l.js → index.Dk0AzWKK.js} +1 -1
  54. streamlit/static/static/js/{index.mDzBI6l2.js → index.Do_EEKkv.js} +1 -1
  55. streamlit/static/static/js/{index.By9mG2hj.js → index.DveSnEeT.js} +1 -1
  56. streamlit/static/static/js/{index.B8cYOVy0.js → index.Dw0WhCiS.js} +1 -1
  57. streamlit/static/static/js/{index.CxgOTC1d.js → index.HyA1RCUq.js} +1 -1
  58. streamlit/static/static/js/{index.C01swFeE.js → index.Nr-h-MEp.js} +1 -1
  59. streamlit/static/static/js/{index.D7j_uG-4.js → index.PrTbO9_K.js} +5 -5
  60. streamlit/static/static/js/{index.CzCK3xQd.js → index.RAvbwGxj.js} +1 -1
  61. streamlit/static/static/js/{index.BvRYYdLA.js → index.jtYhcA9Y.js} +1 -1
  62. streamlit/static/static/js/{index.BsoT67Bp.js → index.krYobKf-.js} +1 -1
  63. streamlit/static/static/js/{input.BjUJQgVM.js → input.dDObaqA1.js} +1 -1
  64. streamlit/static/static/js/{memory.7TMii04U.js → memory.ByHTAQoD.js} +1 -1
  65. streamlit/static/static/js/{mergeWith.BXLP9sI5.js → mergeWith.BZKwBIi3.js} +1 -1
  66. streamlit/static/static/js/{number-overlay-editor.C2Z8Sd28.js → number-overlay-editor.xIt9oCDu.js} +1 -1
  67. streamlit/static/static/js/{possibleConstructorReturn.3LXCoGeT.js → possibleConstructorReturn.CWDGHg1z.js} +1 -1
  68. streamlit/static/static/js/{sandbox.BRs-5jl_.js → sandbox.Bp7KFO4N.js} +1 -1
  69. streamlit/static/static/js/{textarea.DT8T2CKm.js → textarea.BryYk9e_.js} +1 -1
  70. streamlit/static/static/js/{timepicker.BQDylQL_.js → timepicker.BXqQU8Wg.js} +1 -1
  71. streamlit/static/static/js/{toConsumableArray.C9LiuPCd.js → toConsumableArray.jCEZas3E.js} +1 -1
  72. streamlit/static/static/js/{uniqueId.CVZfBH3U.js → uniqueId.Bo8oca1r.js} +1 -1
  73. streamlit/static/static/js/{useBasicWidgetState.DgSV341D.js → useBasicWidgetState.B5KzIWBc.js} +1 -1
  74. streamlit/static/static/js/{useOnInputChange.D1W4Nc13.js → useOnInputChange.DbufYBDh.js} +1 -1
  75. streamlit/static/static/js/{withFullScreenWrapper.DIGqD0pT.js → withFullScreenWrapper.BKsmWq7e.js} +1 -1
  76. streamlit/static/static/media/MaterialSymbols-Rounded.BFCIvovZ.woff2 +0 -0
  77. {streamlit_nightly-1.43.3.dev20250317.dist-info → streamlit_nightly-1.43.3.dev20250318.dist-info}/METADATA +1 -1
  78. {streamlit_nightly-1.43.3.dev20250317.dist-info → streamlit_nightly-1.43.3.dev20250318.dist-info}/RECORD +82 -82
  79. streamlit/static/static/js/index.DHk_4dX7.js +0 -2
  80. streamlit/static/static/media/MaterialSymbols-Rounded.CRt5Q-14.woff2 +0 -0
  81. {streamlit_nightly-1.43.3.dev20250317.data → streamlit_nightly-1.43.3.dev20250318.data}/scripts/streamlit.cmd +0 -0
  82. {streamlit_nightly-1.43.3.dev20250317.dist-info → streamlit_nightly-1.43.3.dev20250318.dist-info}/WHEEL +0 -0
  83. {streamlit_nightly-1.43.3.dev20250317.dist-info → streamlit_nightly-1.43.3.dev20250318.dist-info}/entry_points.txt +0 -0
  84. {streamlit_nightly-1.43.3.dev20250317.dist-info → streamlit_nightly-1.43.3.dev20250318.dist-info}/top_level.txt +0 -0
streamlit/config.py CHANGED
@@ -22,7 +22,7 @@ import secrets
22
22
  import threading
23
23
  from collections import OrderedDict
24
24
  from enum import Enum
25
- from typing import Any, Callable
25
+ from typing import Any, Callable, Literal
26
26
 
27
27
  from blinker import Signal
28
28
 
@@ -86,6 +86,12 @@ class ShowErrorDetailsConfigOptions(str, Enum):
86
86
  # command-line and bool when set via user script (e.g. st.set_option("client.showErrorDetails", False)).
87
87
 
88
88
 
89
+ class CustomThemeCategories(str, Enum):
90
+ """Theme categories that can be set with custom theme config."""
91
+
92
+ SIDEBAR = "sidebar"
93
+
94
+
89
95
  def set_option(key: str, value: Any, where_defined: str = _USER_DEFINED) -> None:
90
96
  """Set config option.
91
97
 
@@ -293,6 +299,36 @@ def _create_option(
293
299
  return option
294
300
 
295
301
 
302
+ def _create_theme_options(
303
+ name: str,
304
+ categories: list[Literal["theme"] | CustomThemeCategories],
305
+ description: str | None = None,
306
+ default_val: Any | None = None,
307
+ visibility: str = "visible",
308
+ type_: type = str,
309
+ ) -> None:
310
+ """
311
+ Create ConfigOption(s) for a theme-related config option and store it globally in this module.
312
+ The same config option can be supported for multiple categories, e.g. "theme" and "theme.sidebar".
313
+ """
314
+ for cat in categories:
315
+ section = cat if cat == "theme" else f"theme.{cat.value}"
316
+
317
+ _create_option(
318
+ f"{section}.{name}",
319
+ description=description,
320
+ default_val=default_val,
321
+ scriptable=False,
322
+ visibility=visibility,
323
+ deprecated=False,
324
+ deprecation_text=None,
325
+ expiration_date=None,
326
+ replaced_by=None,
327
+ type_=type_,
328
+ sensitive=False,
329
+ )
330
+
331
+
296
332
  def _delete_option(key: str) -> None:
297
333
  """Remove a ConfigOption by key from the global store.
298
334
 
@@ -1004,42 +1040,56 @@ _create_option(
1004
1040
 
1005
1041
  _create_section("theme", "Settings to define a custom theme for your Streamlit app.")
1006
1042
 
1007
- _create_option(
1008
- "theme.base",
1043
+ # Create a section for each custom theme element
1044
+ for cat in list(CustomThemeCategories):
1045
+ _create_section(
1046
+ f"theme.{cat.value}",
1047
+ f"Settings to define a custom {cat.value} theme in your Streamlit app.",
1048
+ )
1049
+
1050
+ _create_theme_options(
1051
+ "base",
1052
+ categories=["theme"],
1009
1053
  description="""
1010
1054
  The preset Streamlit theme that your custom theme inherits from.
1011
1055
  One of "light" or "dark".
1012
1056
  """,
1013
1057
  )
1014
1058
 
1015
- _create_option(
1016
- "theme.primaryColor",
1059
+ _create_theme_options(
1060
+ "primaryColor",
1061
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1017
1062
  description="Primary accent color for interactive elements.",
1018
1063
  )
1019
1064
 
1020
- _create_option(
1021
- "theme.backgroundColor",
1065
+ _create_theme_options(
1066
+ "backgroundColor",
1067
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1022
1068
  description="Background color for the main content area.",
1023
1069
  )
1024
1070
 
1025
- _create_option(
1026
- "theme.secondaryBackgroundColor",
1071
+ _create_theme_options(
1072
+ "secondaryBackgroundColor",
1073
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1027
1074
  description="Background color used for the sidebar and most interactive widgets.",
1028
1075
  )
1029
1076
 
1030
- _create_option(
1031
- "theme.textColor",
1077
+ _create_theme_options(
1078
+ "textColor",
1079
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1032
1080
  description="Color used for almost all text.",
1033
1081
  )
1034
1082
 
1035
- _create_option(
1036
- "theme.linkColor",
1083
+ _create_theme_options(
1084
+ "linkColor",
1085
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1037
1086
  description="Color used for all links.",
1038
1087
  visibility="hidden",
1039
1088
  )
1040
1089
 
1041
- _create_option(
1042
- "theme.font",
1090
+ _create_theme_options(
1091
+ "font",
1092
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1043
1093
  description="""
1044
1094
  The font family for all text in the app, except code blocks. One of "sans serif",
1045
1095
  "serif", or "monospace".
@@ -1047,8 +1097,9 @@ _create_option(
1047
1097
  """,
1048
1098
  )
1049
1099
 
1050
- _create_option(
1051
- "theme.codeFont",
1100
+ _create_theme_options(
1101
+ "codeFont",
1102
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1052
1103
  description="""
1053
1104
  The font family to use for code (monospace) in the app.
1054
1105
  To use a custom font, it needs to be added via [theme.fontFaces].
@@ -1056,8 +1107,9 @@ _create_option(
1056
1107
  visibility="hidden",
1057
1108
  )
1058
1109
 
1059
- _create_option(
1060
- "theme.headingFont",
1110
+ _create_theme_options(
1111
+ "headingFont",
1112
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1061
1113
  description="""
1062
1114
  The font family to use for headings in the app.
1063
1115
  To use a custom font, it needs to be added via [theme.fontFaces].
@@ -1065,17 +1117,18 @@ _create_option(
1065
1117
  visibility="hidden",
1066
1118
  )
1067
1119
 
1068
- _create_option(
1069
- "theme.fontFaces",
1120
+ _create_theme_options(
1121
+ "fontFaces",
1122
+ categories=["theme"],
1070
1123
  description="""
1071
1124
  Configure a list of font faces that you can use for the app & code fonts.
1072
1125
  """,
1073
1126
  visibility="hidden",
1074
1127
  )
1075
1128
 
1076
-
1077
- _create_option(
1078
- "theme.baseRadius",
1129
+ _create_theme_options(
1130
+ "baseRadius",
1131
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1079
1132
  description="""
1080
1133
  The radius used as basis for the corners of most UI elements. Can be:
1081
1134
  "none", "small", "medium", "large", "full", or the number in pixel or rem.
@@ -1084,16 +1137,18 @@ _create_option(
1084
1137
  visibility="hidden",
1085
1138
  )
1086
1139
 
1087
- _create_option(
1088
- "theme.borderColor",
1140
+ _create_theme_options(
1141
+ "borderColor",
1142
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1089
1143
  description="""
1090
1144
  The color of the border around elements.
1091
1145
  """,
1092
1146
  visibility="hidden",
1093
1147
  )
1094
1148
 
1095
- _create_option(
1096
- "theme.showBorderAroundInputs",
1149
+ _create_theme_options(
1150
+ "showBorderAroundInputs",
1151
+ categories=["theme", CustomThemeCategories.SIDEBAR],
1097
1152
  description="""
1098
1153
  Whether to show a border around input elements (e.g. text_input, number_input,
1099
1154
  file_uploader, etc).
@@ -1102,8 +1157,9 @@ _create_option(
1102
1157
  visibility="hidden",
1103
1158
  )
1104
1159
 
1105
- _create_option(
1106
- "theme.baseFontSize",
1160
+ _create_theme_options(
1161
+ "baseFontSize",
1162
+ categories=["theme"],
1107
1163
  description="""
1108
1164
  Sets the root font size (in pixels) for the app, which determines the overall
1109
1165
  scale of text and UI elements. The default base font size is 16.
@@ -1112,8 +1168,9 @@ _create_option(
1112
1168
  visibility="hidden",
1113
1169
  )
1114
1170
 
1115
- _create_option(
1116
- "theme.showSidebarSeparator",
1171
+ _create_theme_options(
1172
+ "showSidebarSeparator",
1173
+ categories=["theme"],
1117
1174
  description="""
1118
1175
  Whether to show a vertical separator between the sidebar and the main content.
1119
1176
  """,
@@ -1275,10 +1332,52 @@ def _update_config_with_toml(raw_toml: str, where_defined: str) -> None:
1275
1332
 
1276
1333
  parsed_config_file = toml.loads(raw_toml)
1277
1334
 
1335
+ def process_section(section_path: str, section_data: dict[str, Any]) -> None:
1336
+ """Recursively process nested sections of the config file.
1337
+
1338
+ Parameters
1339
+ ----------
1340
+ section_path : str
1341
+ The dot-separated path to the current section (e.g., "server" or "theme")
1342
+ section_data : dict[str, Any]
1343
+ The dictionary containing configuration values for this section
1344
+
1345
+ Notes
1346
+ -----
1347
+ TOML's hierarchical structure gets parsed into nested dictionaries.
1348
+ For example:
1349
+ [main]
1350
+ option = "value"
1351
+
1352
+ [main.subsection]
1353
+ another = "value2"
1354
+
1355
+ Will be loaded by the TOML parser as:
1356
+ {
1357
+ "main": {
1358
+ "option": "value",
1359
+ "subsection": {
1360
+ "another": "value2"
1361
+ }
1362
+ }
1363
+ }
1364
+
1365
+ This function traverses these nested dictionaries and converts them
1366
+ to dot-notation config options.
1367
+ """
1368
+
1369
+ for name, value in section_data.items():
1370
+ option_name = f"{section_path}.{name}"
1371
+ # Process it as a nested config section if it's a custom theme sub-category
1372
+ if name in [CustomThemeCategories.SIDEBAR.value]:
1373
+ process_section(option_name, value)
1374
+ else:
1375
+ # It's a regular config option, set it
1376
+ value = _maybe_read_env_variable(value)
1377
+ _set_option(option_name, value, where_defined)
1378
+
1278
1379
  for section, options in parsed_config_file.items():
1279
- for name, value in options.items():
1280
- value = _maybe_read_env_variable(value)
1281
- _set_option(f"{section}.{name}", value, where_defined)
1380
+ process_section(section, options)
1282
1381
 
1283
1382
 
1284
1383
  def _maybe_read_env_variable(value: Any) -> Any:
@@ -152,8 +152,11 @@ class ConfigOption:
152
152
  # with a lowercase letter with an optional "_" preceding it.
153
153
  # Examples: "_section", "section1"
154
154
  r"\_?[a-z][a-zA-Z0-9]*"
155
+ # Handling zero or additional parts, separated by period
156
+ # Examples: "_section.subsection", "section1._section2"
157
+ r"(\.[a-z][a-zA-Z0-9]*)*"
155
158
  r")"
156
- # Separator between groups
159
+ # The final period, separating section and name
157
160
  r"\."
158
161
  # Capture a group called "name"
159
162
  r"(?P<name>"
streamlit/config_util.py CHANGED
@@ -88,7 +88,7 @@ def show_config(
88
88
  out.append("")
89
89
 
90
90
  for key, option in section_options.items():
91
- key = option.key.split(".")[1]
91
+ key = option.key.split(".")[-1]
92
92
  description_paragraphs = _clean_paragraphs(option.description or "")
93
93
 
94
94
  last_paragraph_idx = len(description_paragraphs) - 1